<%--
  Created by IntelliJ IDEA.
  User: 野兔瑞贝卡
  Date: 2022/5/12
  Time: 8:33
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
    <script src="../../style/jquery3.6.js"></script>
</head>
<body>
<div>
    <form id="add-form">
        机构名称:<input name="name"><br>
        机构简称:<input name="short_name"><br>
        <button id="sub-btn" type="button">添加</button>
    </form>
</div>
<script>
    //添加按钮的点击事件
    $("#sub-btn").click(function (){
        //提交表单
        $.ajax({
            type:"post",
            url:"../../addOrganization",
            data:$("#add-form").serialize(),
            dataType:"json",
            success:function (json){
                if (json.code == 1){
                    console.log(json.message)
                }
            }
        })
    });
</script>
</body>
</html>
